import { View, Text, Image } from "@tarojs/components";
import Taro from '@tarojs/taro';
import { AtButton, AtAvatar } from 'taro-ui';
import './template.scss'




const Template = () => {

        const to = (v) => {
                console.log(v)
                Taro.navigateTo({
                        url: v
                })
        }

        const xxx = [1, 1, 2, 3]

        //数据渲染，生成模板
        const Xbb = xxx.map((v, i) => {
                return (
                        <View key={i}>
                                {v}
                                <View className='modan'>
                                        <Image /* onClick={() => { to('/pages/Admin/addtemp') }} */ src='https://jdc.jd.com/img/200' />

                                        <View className='jiage'>
                                                <View>3人成团</View>
                                                <View>精品泰国桂圆</View>
                                                <View>1000g/盒</View>
                                                <View>
                                                        <View>￥7.8</View>
                                                        <View>￥ 14.6</View>
                                                </View>
                                        </View>

                                        <View className='tiaojian'>
                                                <View>已成5团 / 可成10团 / 每人限购1份</View>
                                                <View>提货点：鲜丰水果</View>
                                        </View>

                                        <View className='time'>
                                                <View>剩余：</View>
                                                <View>下单2小时后</View>
                                        </View>
                                </View>
                        </View>)

        })
        return (
                <>
                        <View className='index'>
                                <AtButton onClick={() => { to('/pages/Admin/addtemp') }}>新建模板</AtButton>
                        </View>

                        {Xbb}
                        {/* <View>
                                <View className='modan'>
                                        <Image src='https://jdc.jd.com/img/200' />

                                        <View className='jiage'>
                                                <View>3人成团</View>
                                                <View>精品泰国桂圆</View>
                                                <View>1000g/盒</View>
                                                <View>
                                                        <View>￥7.8</View>
                                                        <View>￥ 14.6</View>
                                                </View>
                                        </View>

                                        <View className='tiaojian'>
                                                <View>已成5团 / 可成10团 / 每人限购1份</View>
                                                <View>提货点：鲜丰水果</View>
                                        </View>

                                        <View className='time'>
                                                <View>剩余：</View>
                                                <View>下单2小时后</View>
                                        </View>
                                </View>
                        </View> */}
                </>

        );
};
export default Template;